package com.pingan.internal.point.shopping.vo;

import com.pingan.internal.point.common.domain.Record;
import com.pingan.internal.point.shopping.common.utils.DateUtils;
import com.pingan.internal.point.shopping.entity.Goods;
import com.pingan.internal.point.shopping.entity.GoodsOrder;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class GoodsOrderVo {

    private Long id;

    private String username;

    private String orderSn;
    private String goodsName;
    private int singlePoints;
    private int quantity;

    private String userMessage;
    private String goodsImageName;

    //订单状态
    private int status;

    private String paymentRecordId;
    //订单支付时间
    private String payTime;
    private int totalPoints;

    //订单运送时间
    private String shipTime;
    //订单运送信息
    private String shipMessage;

    public void withGoodsOrder(GoodsOrder order) {
        this.id = order.getId();
        this.username = order.getUsername();
        this.orderSn = order.getOrderSn();
        //订单状态
        this.status = order.getStatus();
        //订单信息
        this.userMessage = order.getUserMessage();
        this.quantity = order.getQuantity();

        //订单运送时间
        this.shipTime = order.getShipTime();
        //订单信息
        this.shipMessage = order.getOrderMessage();
    }

    public void withGoods(Goods goods) {
        this.goodsName = goods.getGoodsName();
        this.singlePoints = goods.getGoodsPoints();
        this.goodsImageName = goods.getGoodsImageName();
    }

    public void withPaymentRecord(Record record) {
        this.paymentRecordId = Long.toString(record.getRecordId());
        this.totalPoints = record.getPoints();
        this.payTime = record.getCreationTime();
    }

}
